<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		function setColor()
					{
						var c = input2.value
						
						switch(c)
						{
							case "red":
								alert("红色");
								document.body.style.backgroundColor=c;
							break;
							case "green":
								alert("绿色");
								document.body.style.backgroundColor=c;
							break;
							case "blue":
								alert("蓝色");
								document.body.style.backgroundColor=c;
							break;
							default:
								alert("用户输入的是其他内容");
								document.body.style.backgroundColor="white";
						}
					}
				</script>
	</body>
</html>
